package com.ding.controller.advice;

import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;

import com.ding.exception.RegisterException;

@ControllerAdvice
public class UserControllerAdvice {//Controller的切面
	@ExceptionHandler(RegisterException.class)	//处理的异常
	public String  registerHandler(RegisterException e,Model model) {
		
		model.addAttribute("error", e.getMessage());
		
		return "exception";
	}
}
